package com.msdemo.config;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
* @comments
* @author zg
* @date 2017年10月17日
*/
@EnableEurekaClient
@SpringBootApplication
public class MSDemoConfigServer {
	private static Class<?> cla = MSDemoConfigServer.class;
	private static Logger logger = LogManager.getLogger(cla);
	
	public static void main(String[] args) {
		ConfigurableApplicationContext cofigAppCont = SpringApplication.run(cla, args);
		ConfigurableEnvironment confEnv = cofigAppCont.getEnvironment();
		String host = confEnv.getProperty("eureka.instance.hostname");
		String port = confEnv.getProperty("server.port");
		//System.out.println("MSDemoEurekaServer started on " + host + ":" + port + " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
		logger.info("MSDemoConfigServer started on {}:{} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", host, port);
	}
}
